package com.collins.enums;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;

public class EnumsTest {
    public static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static void main(String[] args) {
        SeasonEnum[] values = SeasonEnum.values();
        for (SeasonEnum v : values) {
            System.out.println(v);
        }
    }
}

class Season{
    public final String name;
    public final String description;

    private Season(String name, String description) {
        this.name = name;
        this.description = description;
    }

    public static final Season SPRING = new Season("Spring", "warm and balmy");
    public static final Season SUMMER = new Season("Summer", "hot and humid");
    public static final Season AUTUMN = new Season("Autumn", "cool and comfortable");
    public static final Season WINTER = new Season("Winter", "cold and bleak");

    @Override
    public String toString() {
        return "Season{" +
                "name='" + name + '\'' +
                ", description='" + description + '\'' +
                '}';
    }
}

interface sayEnum{
    void say();
}


enum SeasonEnum implements sayEnum{
    SPRING("Spring", "warm and balmy"){
        @Override
        public void say() {
            System.out.println("Spring");
        }
    },
    SUMMER("Summer", "hot and humid") {
        @Override
        public void say() {
            System.out.println("Summer");
        }
    },
    AUTUMN("Autumn", "cool and comfortable"){
        @Override
        public void say() {
            System.out.println("Autumn");
        }
    },
    WINTER("Winter", "cold and bleak"){
        @Override
        public void say() {
            System.out.println("Winter");
        }
    };

    public final String name;
    public final String description;

    private SeasonEnum(String name, String description) {
        this.name = name;
        this.description = description;
    }

}